using UnityEngine;
using QFramework;

namespace Projectsurviva
{
	public partial class GameObject : ViewController
	{
		private float movespd = 5f;
		public static GameObject Default;
        private void Awake()
        {
            Default = this;
        }
        private void OnDestroy()
        {
            Default = null;
        }
        void Start()
		{
			// Code Here
			"hello QFramework".LogInfo();
            Hurtbox.OnTriggerEnter2DEvent(
                (collider) =>
                {
                    this.DestroyGameObjGracefully();
                   // ResKit.Init();
                    UIKit.OpenPanel<UiGameOverpanel>();

                }

                ).UnRegisterWhenGameObjectDestroyed(gameObject);

		}
        private void Update()
        {
			float h = Input.GetAxis("Horizontal");
			float v = Input.GetAxis("Vertical");
			var direction=new Vector2 (h, v).normalized;
			selfrigidbody.velocity = direction * movespd;
        }
    }
}
